<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
 * class MY_Controller extends CI_Controller
 * ----------------------------------------------------------
 * Author:		Michael Lamb
 * Date:		February 2012
 * Version:		0.1
 * ----------------------------------------------------------
 * Synopsis:
 * ---------
 * Extend the CI_Controller class to allow for the catching
 * of unrouted/and non-existant methods
 *
 * ----------------------------------------------------------
 * Methods:
 * --------
 * _remap	Catch all undefined methods
 *
 * ----------------------------------------------------------
 * Planned Changes:
 * -----------------
 *
 * 
 * ----------------------------------------------------------
 * Version History:
 * -----------------
 * - _remap for catching undefined methods
 *
 * ----------------------------------------------------------
 * ##########################################################
 * ----------------------------------------------------------
 */
class MY_Controller extends CI_Controller {
	/**
	 * Name: _remap
	 * Scope: Public
	 * 
	 * @params:
	 * 		$method - string
	 * 		$params - array
	 */
	public function _remap($method, $params = array())
	{
		if(!method_exists($this, $method))
		{
			if ($this->uri->segment(1))
			{
	            
				$this->index($this->uri->segment(1), $params);
            }
			else
			{
                $this->index();
            }
		}
		else
		{
			return call_user_func_array(array($this, $method), $params);
		}
		
	}
}

/* End of file main.php */
/* Location: ./application/controllers/main.php */